﻿
namespace Anno.EngineData.Cache
{
    /// <summary>
    /// 缓存配置
    /// </summary>
    public class CacheOptions
    {
        /// <summary>
        /// 缓存类型
        /// </summary>
        public CacheType CacheType { get; set; }

        /// <summary>
        /// Redis配置
        /// </summary>
        public string RedisConnectionString { get; set; }
    }

    public enum CacheType
    {
        /// <summary>
        /// 内存缓存
        /// </summary>
        MemoryCache,

        /// <summary>
        /// Redis缓存
        /// </summary>
        RedisCache
    }

    #region 缓存时长
    /// <summary>
    /// 缓存时长
    /// </summary>
    public enum ExpiresTime
    {
        /// <summary>
        /// 不限
        /// </summary>
        None = 0,
        /// <summary>
        /// 1分钟
        /// </summary>
        Minutes_1 = 1,
        /// <summary>
        /// 15分钟
        /// </summary>
        Minutes_15 = 15,
        /// <summary>
        /// 30分钟
        /// </summary>
        Minutes_30 = 30,

        /// <summary>
        /// 1小时
        /// </summary>
        Hours_1 = 60,

        /// <summary>
        /// 2小时
        /// </summary>
        Hours_2 = 120,

        /// <summary>
        /// 4小时
        /// </summary>
        Hours_4 = 240,
        /// <summary>
        /// 8小时
        /// </summary>
        Hours_8 = 480,
        /// <summary>
        /// 12小时
        /// </summary>
        Hours_12 = 720,
    }
    #endregion
}